import request from '@/utils/request'

// 获取文章列表

export const getArticle = (params)=> request({
    url:'mp/articles',
    params: params
})
// 删除文章
export const deleteArticle = (id)=> request({
    url:'/mp/articles/'+ id,
    method: 'DELETE'
})


// 发布文章
export const publishArticle = (data,state)=> request({
    url:'mp/articles',
    method: 'POST',
    params:{draft:state},
    data
})

// 获取文章详情

export const getArticleMsg = (id) => request({
    url:'mp/articles/'+ id
})

// 修改文章
export const eideArticle = (data,state,id)=> request({
    url:'mp/articles/' + id,
    method: 'PUT',
    params:{draft:state},
    data
})